package com.atguigu.config;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @Description :
 * @Version : V1.0.0
 * @Date : 2022/9/2 11:19
 */
public class WindowsCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        final String property = context.getEnvironment().getProperty("os.name");
        if (property.contains("Windows")) {
            return true;
        }
        return false;
    }
}
